package cn.edu.zju.gis.disasterBE.sever.service;

import cn.edu.zju.gis.disasterBE.sever.dao.DisasterProductDAO;
import cn.edu.zju.gis.disasterBE.sever.entity.DisasterProduct;
import cn.edu.zju.gis.disasterBE.sever.entity.global.MyResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class DisasterProductService {
    protected final DisasterProductDAO disasterProductDAO;

    public MyResponse<List<DisasterProduct>> disasterProductGetAll()
    {
        List<DisasterProduct> disasterProductResponses = disasterProductDAO.getDisasterProductAll();
        MyResponse<List<DisasterProduct>> myResponse = new MyResponse<>();
        myResponse.setData(disasterProductResponses);
        myResponse.setState(true);
        myResponse.setMsg("Read images successfully");
        return myResponse;
    }
}
